package com.sixstones.fragment.vo;

import com.sixstones.fragment.enums.ResultEnum;

public class FragmentResult {

	private int code;
	private String error;
	private boolean success;

	private Object data;

	public FragmentResult(ResultEnum result, boolean isSuccess) {
		super();
		this.code = result.getCode();
		this.error = result.getMessage();
		this.success = isSuccess;
	}

	public FragmentResult(int code, String error, boolean isSuccess) {
		super();
		this.code = code;
		this.error = error;
		this.success = isSuccess;
	}

	public FragmentResult(int code, String error, boolean success, Object data) {
		super();
		this.code = code;
		this.error = error;
		this.success = success;
		this.data = data;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public void setResult(ResultEnum result, boolean success) {
		this.code = result.getCode();
		this.error = result.getMessage();
		this.success = success;
	}

}
